1. Field of the Invention
The present invention relates generally to power management in a computer system and more particularly to interfacing a keyboard sleep/wake key to a computer system.
2. Description of Related Art
With the advent of portable computers there has always been a need to regulate and conserve power consumed by the computer. However, the need to conserve power now extends to desktops, servers and other types of non-portable computers. Computers are left on to answer phones, receive faxes and connect to each other. All these functions only run when the computer system is consuming power. Therefore, a fully functional computer system with very low power is desirable.
Early attempts at power management included a scheme known as Advanced Power Management (APM). APM basically powers down the computer system to an acceptable power level when it is not in use. However, as the PC platform has evolved and new capabilities and performance have been added to the computer system, APM has no longer been able to meet the power management requirements.
Another attempt to the solve power management issues blended the existing collections of power management basic input/output services (BIOS) code, APM application programming interfaces (APIs), and plug and play BIOS APIs into an Advanced Configuration and Power Management (ACPI) specification hereby incorporated by reference. The ACPI specification describes a mechanism for operating system directed power management (OSPM). However, while ACPI provides mechanisms for certain legacy hardware to wake a sleeping computer, it does not provide guidance for all legacy hardware.
To take advantage of the power management functionality of the ACPI specification it is desirable for the user to wake the computer with the simple push of a button. In the past, a power management function was provided through the power on/off switch. A more convenient method is desirable. Additionally, it is desirable to avoid making changes to the legacy hardware.
A computer system includes a keyboard having keys and a keyboard controller coupled to the keyboard for generating a keyboard interrupt when a key is actuated. A status register for receiving an event indication that causes the computer system to manage power in response to the event indication is also included. Between the keyboard controller and the status register is routing logic for selectively routing the keyboard interrupt to the status register only if the computer system is in a low power mode.
A special sleep/wake key is provided on the keyboard which when actuated causes special scan codes to be provided to the keyboard controller. If the computer is not in a low power mode, the special scan codes causes the computer to be placed in a low power mode and cause the keyboard interrupt to be routed to the status register. If the computer is in a low power mode, the special scan code causes the computer to wake up and cause the keyboard interrupt to be disabled from the status register. The keyboard controller may be contained in a multifunction input/output controller and the status register may be contained in a south bridge.
The status register may correspond to an advanced configuration and power interface (ACPI) specification. The interrupt generated by the status register may be a system control interrupt or a system management interrupt.
A method of managing power in a computer system having a keyboard coupled to a keyboard controller is also disclosed. The method includes receiving a sleep indication from the keyboard; placing the computer in a low power state wherein certain external events to a status register may awake the computer system in response to the sleep indication; and enabling a connection between the keyboard controller and the status register in response to the sleep indication, the connection for passing a keyboard interrupt to wake the computer system when a wake indication is provided from the keyboard. The method also includes receiving a wake indication from the keyboard; waking the computer in response to the wake indication; and disabling the connection between the keyboard controller and the status register in response to the wake indication.
The computer system may include a programmable interrupt controller selectively connected to the status register. If so, the method may include connecting the status register to the programmable interrupt controller register in response to the sleep indication; and disabling all inputs to the programmable interrupt controller except for an input connected to the status register in response to the sleep indication. The method may also include disconnecting the status register to the programmable interrupt controller register in response to the wake indication; and enabling all inputs to the programmable interrupt in response to the wake indication.
The sleep and wake indications may correspond to special scan codes. The keyboard may also include the capability to ignore all keys except the sleep/wake key. Thus, the method may include providing a command to the keyboard in response to the sleep indication to filter out all scan codes except for scan codes corresponding to a wake indication.